/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.shop.entity;

import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.thinkgem.jeesite.common.persistence.DataEntity;

/**
 * 广告位管理Entity
 * @author xxs
 * @version 2016-08-31
 */
public class Ad extends DataEntity<Ad> {
	
	private static final long serialVersionUID = 1L;
	
	private AdPosition adPosition;		// 广告位ID 父类
	private String name;		// 标题
	private String content;		// 说明
	private String image;		// 图片
	private String url;		// url地址
	private Date beginDate;		// 开始时间
	private Date endDate;		// 结束时间
	
	public Ad() {
		super();
	}

	public Ad(String id){
		super(id);
	}

	public Ad(AdPosition adPosition){
		this.adPosition = adPosition;
	}

	@Length(min=0, max=64, message="广告位ID长度必须介于 0 和 64 之间")
	public AdPosition getAdPosition() {
		return adPosition;
	}

	public void setAdPosition(AdPosition adPosition) {
		this.adPosition = adPosition;
	}
	
	@Length(min=0, max=100, message="标题长度必须介于 0 和 100 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Length(min=0, max=200, message="说明长度必须介于 0 和 200 之间")
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	@Length(min=0, max=200, message="url地址长度必须介于 0 和 200 之间")
	public String getUrl() {
		return url;
	}
	
	public void setUrl(String url) {
		this.url = url;
	}
	@Length(min=0, max=200, message="image长度必须介于 0 和 200 之间")
	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getBeginDate() {
		return beginDate;
	}

	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	
}